How to boost or penalize a subset of records in the search results.
boosted
attribute in the following dataset.
boosted
attribute"32"
).customRanking
. It lets you define a list of attributes used to rank the results in the case of textual relevance equality.
To boost featured fruits, you need to add the boosted
attribute to the custom ranking from the dashboard or the API.
boosted
attribute is a boolean
data type, ensure you have set the order of the custom ranking attribute to descending.customRanking
is set, querying a
will return “almonds” first, as it matches both textually AND is a featured record.
If more granularity is necessary, a similar method can be used. Instead of a boolean attribute, you will need to specify a numeric attribute that maps to a boosted “level”.
In this case, the dataset might look like this:
customRanking
as it’s already set to rank by the boosted
attribute in descending order.
In this example, the query a
it will return “apple” first because it has the highest boosted
value.